/*
 * Copyright (c) 2025-2025 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef AUDIO_XPERF_EVENT_H
#define AUDIO_XPERF_EVENT_H

#include "xperf_service_log.h"
#include "xperf_event.h"
#include <string>

namespace OHOS {
namespace HiviewDFX {

class AudioXperfEvent : public OhosXperfEvent {
public:
    int16_t status{0};
    int64_t uniqueId{0};
    int16_t faultId{0};
    int16_t faultCode{0};
    int maxFrameTime{0};
};

class AudioStateEvent : public OhosXperfEvent {
public:
    int64_t uniqueId{0};
    int32_t pid{0};
    std::string bundleName;
    int64_t happenTime{0};
    int16_t status{0};

    std::string toString()
    {
        std::string str = "pid:" + std::to_string(pid)
            + " uniqueId:" + std::to_string(uniqueId)
            + " bundleName:" + bundleName
            + " happenTime:" + std::to_string(happenTime)
            + " status:" + std::to_string(status);
        return str;
    }
};

} // namespace HiviewDFX
} // namespace OHOS

#endif